(function($){ 


	var methods={ 
		init:function(options){ 
			 return this.each(function() {
                var $this = $(this);
 
                 
                var settings = $this.data("information");
                if (typeof settings === "undefined") {
 
                    var defaults = {
                    	elem:'info_lefts',
                        Tops: 210,
                        onSomeEvent: function() { 
                        	 var Top_line=$(window).scrollTop();
                        	 if(Top_line > defaults.Tops){ 
                        	 	//alert("dasd");
                        	 	//$("."+defaults.elem).css("position","fixed").css("top","-10px");
                        	 	$("."+defaults.elem).addClass("transition-move");
                        	 	$("."+defaults.elem).css("position","fixed").css("top","0px");
                        	 } else{ 
                        	 	$("."+defaults.elem).removeClass("transition-move");                        	 	 
                        	 	$("."+defaults.elem).css("position","static").css("top","-300px");
                        	 	 
                        	 	
                        	 }
                        }
                    };
 
                    settings = $.extend({}, defaults, options);
 
                     
                    $this.data("information", settings);
                } else {
                   
                    settings = $.extend({}, settings, options);
  
                    $this.data("information", settings);
                }
 
                
                return settings.onSomeEvent();
 
            });

		},
			//Notice

			destroy: function(options) {
            return $(this).each(function() {
                var $this = $(this);
                var defaults={
                	clos_class:'we_text',
                	eles:'Reply_per',
                	quxiao:'Reply_Cancel'
                }
                var opts=$.extend( {}, defaults, options || {} );
                $this.closest('.'+opts.clos_class).find('.'+opts.eles).show();
                $("."+opts.quxiao).click(function(){ 
                	$(this).closest("."+opts.eles).hide();
                });
                //alert(opts.clos_class);
                return $this;
 				 
            });
        },

        //Notice

			Cancel: function(options) {
            return $(this).each(function() {
                var $this = $(this);
                var defaults={
                	clos_class:'we_text',
                	eles:'xiangmu_s_right_text',
                	type:'text',
                	Switch:false
                }
                var opts=$.extend( {}, defaults, options || {} );

                if(opts.Switch){ 
                	 var A=$this.closest('.'+opts.eles).find('input:'+opts.type).length;
                }
                else{ 
                	
                }

               
               	 //alert(A);
                return $this;
 				 
            });
        },

        //passS
        passS:function(options){ 
        	return $(this).each(function(){ 
        		var $this=$(this);
        		var defaults={ 
        			onFa:true,
        			eles:'pass_text',
        			parents:'modal',
        			change:false,
        			off:true
        		}
        		  var opts=$.extend( {}, defaults, options || {} );
        		var $D= $this.closest("."+opts.parents).find("."+opts.eles);
        		var D_height=$D.height();
        		var T_height=$this.height();
        		if (opts.onFa) {
        			if(opts.change){

        				$D.find("li").bind('click',function(){
							var $_this=$(this);
							$D.find("li").each(function(){
								$(this).find("a").removeClass("pat_on")
								$(this).find("span").hide();
							});
							$_this.find("a").addClass("pat_on");
							$(this).find("span").show();
							var S=$_this.find("a").text();
							var B=$_this.attr("data");
							$this.closest("."+opts.parents).find(".pass_on").attr("data","");
							$this.closest("."+opts.parents).find(".pass_on").val(S);
							$this.closest("."+opts.parents).find(".pass_on").attr("data",B);
							});



        			}else{

                        $this.focus(function () {
                            $this.closest(".pass_shen").css("position", "relative");
                            if (opts.off) {

                            } else {
                                $D.css("top", -(D_height + T_height) + "px");
                            }
                            $D.show();
                            $D.find("li").unbind("click");
                            $D.find("li").bind('click', function () {
                                var $_li = $(this);
                                //console.log($_li.find("a").hasClass("pat_on"));
                                var text="";
                                var val="";
                                if ($_li.find("a").hasClass("pat_on")) {
                                    $_li.find("a").removeClass("pat_on").siblings("span").hide();
									//console.log($_li.html());
                                } else {
                                    /*$D.find("li").each(function (index,ele) {
                                        $(ele).find("a").removeClass("pat_on")
                                        $(ele).find("span").hide();
                                    });*/
                                    $D.find("li").find("a").removeClass("pat_on").end().find("span").hide();
                                    $_li.find("a").addClass("pat_on");
                                    $_li.find("span").show();
                                    text = $_li.find("a").text();
                                    val = $_li.attr("data");
                                }
                                $this.attr("data", val);
                                $this.val(text);
                                if($this.attr("data-target")){
                                    $($this.attr("data-target")).val(val);
                                };
                            });
                            $D.hide();
                        });
        			}


        		}

        		else if(opts.onFa==null){
        			var $D= $this.find("."+opts.eles);

        			if($this.next().hasClass("chuang_right"))
        			{

        				$this.find("."+opts.eles).show();
        				 $D.find("li").click(function(){
        				 	var $_this=$(this);
							$D.find("li").each(function(){
								$(this).find("a").removeClass("pat_on")
								$(this).find("span").hide();
							});
									$_this.find("a").addClass("pat_on");
									var dats=$_this.attr("data");
									var picurl=$_this.attr("picurl");
									var texts=$_this.text();
									$this.css("background","url('"+ picurl+"') 0 0 no-repeat");
									$this.css("background-size","100%,100%");
									$this.attr("data",dats);
									$this.next(".chuang_right").text(texts);
									$_this.find("span").show();
									$this.closest("."+opts.parents).find("."+opts.eles).hide();

        				 });

        				}
        				else{

        					$D.css("display","block");
        					$D.find("li").click(function(){
        				 	var $_this=$(this);
							$D.find("li").each(function(){
								$(this).find("a").removeClass("pat_on")
								$(this).find("span").hide();
							});
									$_this.find("a").addClass("pat_on");

									var texts=$_this.text();
									var dats=$_this.attr("data");
									$this.attr("data",dats);
									$this.find(".task-zixiang-input").val(texts);
									$_this.find("span").show();

        				 });
        					$D.hide();
        				}



        		}

        		else{
        			$this.closest("."+opts.parents).find("."+opts.eles).show();
        			$D.find("li").bind('click',function(){
							var $_this=$(this);
							$D.find("li").each(function(){
								$(this).find("a").removeClass("pat_on")
								$(this).find("span").hide();
							})
							$_this.find("a").addClass("pat_on");
							$(this).find("span").show();

							});

        			$D.hide();

        		}




			 return $this;
        	});


        },
         //passS

          //passS2
        passS2:function(options){
        	return $(this).each(function(){
        		var $this=$(this);
        		var defaults={
        			onFa:true,
        			eles:'pass_text',
        			parents:'modal',
        			change:true,
        			ids:'members0userId'

        		}
        		  var opts=$.extend( {}, defaults, options || {} );
        		var $D= $this.find("."+opts.eles);
        		if (opts.onFa){
        			if(opts.change){
        				$D.find("li").bind('click',function(){
							var $_this=$(this);
							$D.find("li").each(function(){
								$(this).find("a").removeClass("pat_on")
								$(this).find("span").hide();
							});
							$_this.find("a").addClass("pat_on");
							$(this).find("span").show();
							var S=$_this.find("a").text();
							var B=$_this.attr("data");
							$this.closest("."+opts.parents).find(".pass_on").attr("data","");
							$this.closest("."+opts.parents).find(".pass_on").val(S);
							$this.closest("."+opts.parents).find(".pass_on").attr("data",B);
							});

        			}


        		}

        		else{
        			$this.find("."+opts.eles).show();
        			$D.find("li").bind('click',function(){
							var $_this=$(this);
							$D.find("li").each(function(){
								$(this).find("a").removeClass("pat_on")
								$(this).find("span").hide();
							})
							});
        		}




			 return $this;
        	});


        },
         //passS2

         //Staff
         Staff:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         			eles:'juese_ss',
         			parents:'parents'
         		}
         		var opts=$.extend({},defaults,options || {});
         		var $D=$this.parent().find("li");
         		var $O=$this.find("span");
         		var $U=$this.find("span").is(":hidden");
         		var text=$this.find("a").text();

         		//alert($L);
         		var amy=new Array();
         		var idm=new Array();
         			 var index=$this.index();
         		//alert($U);
         		if($U){

         			$O.show();
         			$this.find("a").addClass("pat_on");
         			var $L=$this.parent().find("span:visible").length;

         			 var str="";
         			 var datas=$this.attr("data");
         			 str='<input type="hidden" ids="'+datas+'" data="'+index+'" value="'+text+'" >';
         			 $this.closest(".per_lisr").append(str);

         		}


         		else{
         			$O.hide();
         			$this.find("a").removeClass("pat_on");
         			$this.closest(".per_lisr").find("input:hidden").each(function(){

         			 	var vals=$(this).val();
         			 	var dats=$(this).attr("data");

         			 	 if((vals==text) && (index==dats))
         			 	 {
         			 	 	$(this).remove();
         			 	 	return;
         			 	 }
         			 });

         		}
				 	$this.closest(".per_lisr").find("input:hidden").each(function(){
         			 	var vals=$(this).val();
         			 	var ids=$(this).attr("ids");
         			 	amy=amy+vals+",";
         			 	idm=idm+ids+",";
         			 });
         		 $("."+opts.eles).val(amy);
         		 $("."+opts.eles).attr("data",idm);
         	return $this;
         	});

         },

         //Staff
         //Dels
         Dels:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         			eles:'Choice_man'

         		}
         		var opts=$.extend({},defaults,options || {});
         		 $this.click(function(){
         		 	if($this.hasClass("Choice_man")){

	         		}else{

	         			$this.remove();

	         		}
         		 });


         	return $this;
         	});

         },

         //Dels

         //size_changes
         size_changes:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         			clos_class:"taol_neirong",
	  				eles:"all_per",
	  				ri_text:'taolun_ins_right_text',
	  				le_c1:'tao_ground_con',
  					le_c2:'tao_ground_right_ul',
  					le_c3:'taolun_ins_left',
  					le_c4:'taolun_ins_right'
         		}
         		var opts=$.extend({},defaults,options || {});
         		var $H=$this.height();
         		$("."+opts.le_c3).css("height",$H-10-40-90-60+"px");
         		$("."+opts.le_c4).css("height",$H-10-40-90-60+"px");
         		var $A_hs=$("."+opts.le_c3).css("height");
         		$("."+opts.clos_class).css("height",parseInt($A_hs)-50+"px");
         		var $H_D=$("."+opts.clos_class).css("height");
         		$("."+opts.le_c1).css("height",parseInt($H_D)-40+"px");
         		$("."+opts.le_c2).css("height",parseInt($H_D)-40+"px");
         		$("."+opts.ri_text).css("height",parseInt($A_hs)-40-50-50+"px");
         		return $this;
         	});
         },
 //Task
        Task:function(options){
        	return $(this).each(function(){
        		var $this=$(this);
        		var defaults={
        			onFa:true,
        			eles:'pass_text',
        			List:'pass_con_list',
        			elem:'Task_onc'
        		}

				var opts=$.extend( {}, defaults, options || {} );
        		var Top=$this.height();
        		var amy=new Array();
        		var idm=new Array();
        		var str="";
        		var $S=$this.next("."+opts.eles).find("."+opts.List);
        	 	//显示

        	 	$("."+opts.eles).hide();
        			$("."+opts.elem).each(function(){
        				$(this).removeClass("check");
        			});
        			$this.addClass("check");
	        		$this.next("."+opts.eles).css("top",Top+"px");
	        		$this.next("."+opts.eles).show();
				return $this;
        	});


        },
        Task_list:function(options){
        	return $(this).each(function(){
        		var $this=$(this);
        		var defaults={
        			onFa:false,
        			intext:'types',
       			 	elem:'choose_class'
        		}

        		var opts=$.extend( {}, defaults, options || {} );
        		var data=new Array();
        		var data_sid=new Array();
        		if(opts.onFa){
        			//单选
        			var data_id=$this.attr("data-id");
        			var text=$this.find("a").text();
        			$this.closest('.'+opts.elem).find("."+opts.intext).attr("data-id",data_id);
        			$this.closest('.'+opts.elem).find("."+opts.intext).text(text);
        			$this.parent().find("li").each(function(){
        				$(this).find('span').hide();
        				$(this).removeAttr("style");
        			});
        			$this.find('span').show();
        			$this.css("background","#f2f2f2");
        			$this.closest('.Pop_up_box').hide();
        			$this.closest('.task-ru-list').find(".check").removeClass("check");
        		}else{
        			//多选
        			var data_id=$this.attr("data-id");
        			var text=$this.find("a").text();

        			if($this.find("span").css("display")=="block"){
        				//点击取消
        				$this.find("span").hide();
        				$this.removeAttr("style");
        			}else{
        				$this.find("span").show();
        				$this.css("background","#f2f2f2");
        			}

        			$this.parent().find("li").find("span").each(function(){
        				if($(this).is(":hidden")){

        					$this.closest('.'+opts.elem).find("."+opts.intext).text(data);
        				}else{
        					var con_text=$(this).parent().find("a").text();
        					var con_data_id=$(this).parent().attr("data-id");
        					data+=con_text+",";
        					data_sid+=con_data_id+",";
        				}

        				$this.closest('.'+opts.elem).find("."+opts.intext).text(data);
        				$this.closest('.'+opts.elem).find("."+opts.intext).attr("data-id",data_sid);

        				if($this.closest('.'+opts.elem).find("."+opts.intext).text()==''){
        					$this.closest('.'+opts.elem).find("."+opts.intext).text('全部');
        				}
        			});
        		}

				return $this;
        	});


        },
		/* 下拉选项 */
		dropSelect:function(options){
			return $(this).each(function(){
				var $this=$(this);
				var defaults={
					onFa:true,
					eles:'drop-select-div',
					List:'drop-select-menu',
					elem:'drop-select'
				}

				var opts=$.extend( {}, defaults, options || {} );
				var Top=$this.height();
				var amy=new Array();
				var idm=new Array();
				var str="";
				var $S=$this.next("."+opts.eles).find("."+opts.List);
				//显示

				$("."+opts.eles).hide();
				$("."+opts.elem).each(function(){
					$(this).removeClass("check");
				});
				$this.addClass("check");
				$this.next("."+opts.eles).css("top",Top+"px");
				$this.next("."+opts.eles).show();
				return $this;
			});
		},

		dropOption:function(options){
			return $(this).each(function(){
				var $this=$(this);
				var defaults={
					intext:'selected-text',	//文本样式
					sel:'selected',			//选中样式
					elem:'drop-select-container'	//下拉选择容器
				}

				var opts=$.extend( {}, defaults, options || {} );
				var data=new Array();
				var data_sid=new Array();
				var $selectMenu = $this.parent();
				/* 多选 */
				var mul = $selectMenu.attr("select-type");
				/* 取消标记 */
				var cancel = $selectMenu.attr("cancel-flag");

				if(mul != "multiple"){
					// 单选
					if (cancel == "off" && $this.find("a."+opts.sel).length>0){
						return $this;
					}
					if ($this.find("a."+opts.sel).length==0){
						$selectMenu.find("a").removeClass(opts.sel);
					}
					$this.find("a").toggleClass(opts.sel);
					$this.closest('.Pop_up_box').hide();
				}else{
					$this.find("a").toggleClass(opts.sel);
				}

				$this.parent().find("."+opts.sel).each(function(){
					var data_id=$(this).parent().attr("data-id");
					var text=$(this).text();
					data.push(text);
					data_sid.push(data_id);
				});

				var $elem = $this.closest('.'+opts.elem).find("."+opts.intext);
				if (data.length==0){

					var default_text = $elem.data("default-text");
					if (default_text==undefined || default_text==""){
						default_text = "请选择";
					}
					$elem.text(default_text);
					$elem.attr("data-id",default_text);
				}else{
					$elem.text(data.join(","));
					$elem.attr("data-id",data_sid.join(","));
				}
				var aa = $this.closest('.'+opts.elem);
				return $this;
			});


		},
        /*
          //Task
        Task_list:function(options){
        	return $(this).each(function(){
        		var $this=$(this);
        		var defaults={
        			onFa:true,
        			eles:'pass_text',
        			List:'pass_con_list',
        			elem:'Task_onc'
        		}

        		  var opts=$.extend( {}, defaults, options || {} );
        		var Top=$this.height();
        		var amy=new Array();
        		var idm=new Array();
        		var str="";
        		var $S=$this.next("."+opts.eles).find("."+opts.List);
        		//alert(Top);
        		if(opts.onFa){
        			$("."+opts.eles).hide();
        			$(".Task_onc").each(function(){
        				$(this).removeClass("check");
        			});
        			$this.addClass("check");
	        		$this.next("."+opts.eles).css("top",Top+"px");
	        		$this.next("."+opts.eles).show();
        			 //
        			 $S.find("li").click(function(){
	        				$S.find("li").each(function(){
	        					$(this).find("span").hide();
	        					$(this).removeClass("Task-c");
	        				});
	        					var texts=$(this).text();
	        					var data=$(this).attr("data");
	        					$(this).find("span").show();
	        					$(this).addClass("Task-c");
	        					$this.find("span").text(texts).attr("data",data);
	        			});
        			 //
	        	}else{

	        		$("."+opts.eles).hide();
	        		$("."+opts.elem).removeClass("check");

	        			$this.addClass("check");
		        		$this.next("."+opts.eles).css("top",Top+"px");
		        		$this.next("."+opts.eles).show();

		        		//
		        		$S.find("li").click(function(){
        						 	idm="";
		        					var texts=$(this).text();
		        					var data=$(this).attr("data");
		        					$(this).find("span").show();
				         			 str='<input type="hidden" ids="'+data+'"  value="'+texts+'" >';
				         			 $this.next("."+opts.eles).append(str);

				         			 $this.find("span").text('');
				         			  amy="";

				         	  		console.log($(this).hasClass("Task-c"));
				         	  		//if
				         	 if($(this).hasClass("Task-c")){

				         	 	 $this.next("."+opts.eles).find("input:hidden").each(function(){
				         	 	 	if($(this).attr("ids")==data){
				         	 	 		$(this).remove();

				         	 	 	}
				         	 	 	 	return true;
				         	 	 });
				         	 	 	$this.next("."+opts.eles).find("input:hidden").each(function(){
				         			 	var vals=$(this).val();
				         			 	var ids=$(this).attr("ids");
				         			 	amy=amy+vals+",";
				         			 	idm=idm+ids+",";
				         			 });

				         	 		$(this).removeClass("Task-c");
				         	 		$(this).find("span").hide();
				         	 }else{
				         	 	$this.next("."+opts.eles).find("input:hidden").each(function(){
				         			 	var vals=$(this).val();
				         			 	var ids=$(this).attr("ids");
				         			 	amy=amy+vals+",";
				         			 	idm=idm+ids+",";
				         			 });
				         	 	$(this).addClass("Task-c");
				         	 	$(this).find("span").show();
				         	 }
				         		//end
				         	 	$this.find("span").text(amy);
				         	 	$this.find("span").attr("data","");
			         			$this.find("span").attr("data",idm);


		        			});
	//
	        	}





				return $this;
        	});


        },
         //Task
         */
           //select-zhunag
       zhunag:function(options){
        	return $(this).each(function(){
        		var $this=$(this);
        		var defaults={
        			elem:'task-input-ul',
        			eles:'task-input-ms'
        		}

        		var opts=$.extend( {}, defaults, options || {} );
        		var $D=$this.next("."+opts.elem);
        		//显示下拉列表
        		$("."+opts.elem).hide();
        		$("."+opts.eles).css("position","static");
        		$D.show();
        		$D.closest("."+opts.eles).css("position","relative");
        		//下拉列表点击获取值
        		$D.find("li").each(function(){
        			$(this).click(function(){
        				$this.empty();
        				var data=$(this).attr("data");
        				var fins=$(this).attr("data-ondis");
        				var img="";
        				img='<img src="'+data+'" class="shows-pak" data-ondis="'+fins+'"/>';
        				$this.append(img);
        				//$D.hide();
        				if(fins=="finish"){
        					$this.parent().parent().parent().find("td").css("text-decoration","line-through").css("color","#ccc");
        					$this.parent().parent().parent().find("td").find("a").css("text-decoration","line-through").css("color","#ccc");
        					$this.parent().parent().parent().find("td").eq(0).removeAttr("style");
        				}else{
        					$this.parent().parent().parent().find("td").removeAttr("style");
        					$this.parent().parent().parent().find("td").find("a").removeAttr("style");
        				}
        				$D.hide();
        			});


        		});



				return $this;
        	});


        },
         //select-zhunag

         //tables

         tablse:function(options){
         	return $(this).each(function(){
         		var $this=$(this);

         		var defaults={
         			bgcolor:'#f8f8f8',
         			elem:'task-input-img',
         			url:'images/qi_off.png',
					url_off:'images/qi_on.png'
         		}
         		var opts=$.extend({},defaults,options || {});

         		$this.find("."+opts.elem).click(function(){
         			var data_State=$(this).attr("data-State");
         			//console.log(data_State);
         			if(data_State=="yes"){
         				$(this).attr("src",opts.url);
         				$(this).attr("data-State","no");
         			}else{
         				$(this).attr("src",opts.url_off);
         				$(this).attr("data-State","yes");
         			}
         		});
         	});


         },

         Fixm:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         			topm:'pro_top',
					top_nav:'tema_index_top',
					mian_h:'xian_mu_top',
					elem:'task_cont',
					eles:'task-B-con',
					taks_left:'task-B-left',
					taks_right:'task-B-r-cs',
					flag:false

         		}
         		var opts=$.extend({},defaults,options || {});

         		var $A=$("."+opts.topm).height();
         		var $B=$("."+opts.top_nav).height();
         		var $C=$("."+opts.mian_h).height();
         		var $D=$("."+opts.elem).height();
         		var $M=$(window).height();
         		var $V=$("."+opts.eles).height();
         		var $W=$(window).width();
         		 //console.log($M);
         		//console.log($A+"|"+$B+"|"+$C);
         		var Top_line=$(window).scrollTop();

         	if(opts.flag){

         		if(Top_line>($A+$B+$C)){
	         			 $("."+opts.elem).css("position","fixed").css("z-index","99999").css("top","0px");
	         			 $("."+opts.eles).css("height",$V+"px");
	         			 $("."+opts.taks_right).css("height",$M-$D+"px").css("overflow","hidden").css("overflow-y","scroll").css("position","fixed").css("z-index","99998").css("top",$D+"px");
	         			 $("."+opts.taks_left).css("height",$M-$D+"px").css("overflow","hidden").css("overflow-y","scroll").css("position","fixed").css("z-index","99998").css("top",$D+"px").css("right",($W-1170)/2+"px");
	         		}
	         		else if(Top_line>($A+$B+$C+$D)){
	         			$("."+opts.eles).css("height",$V+"px");
	         			//$("."+opts.eles).css("height",$M-$D+"px").css("position","fixed").css("z-index","99999").css("top",$D+"px");
	         		}
	         		else{
	         			 $("."+opts.elem).css("position","static").css("z-index","99999").css("top","0px");
	         			  $("."+opts.eles).removeAttr("style");
	         			 $("."+opts.taks_left).removeAttr("style");
	         			 $("."+opts.taks_right).removeAttr("style");
	         		}

         		}
         	else{
	         		if(Top_line>($A+$B+$C)){
	         			 $("."+opts.elem).css("position","fixed").css("z-index","99999").css("top","0px");
	         			 $("."+opts.eles).css("height",$V+"px");
	         			 $("."+opts.taks_left).css("height",$M-$D+"px").css("overflow","hidden").css("overflow-y","scroll").css("position","fixed").css("z-index","99998").css("top",$D+"px");
	         			 $("."+opts.taks_right).css("height",$M-$D+"px").css("overflow","hidden").css("overflow-y","scroll").css("position","fixed").css("z-index","99998").css("top",$D+"px").css("right",($W-1170)/2+"px");
	         		}
	         		else if(Top_line>($A+$B+$C+$D)){
	         			$("."+opts.eles).css("height",$V+"px");
	         			//$("."+opts.eles).css("height",$M-$D+"px").css("position","fixed").css("z-index","99999").css("top",$D+"px");
	         		}
	         		else{
	         			 $("."+opts.elem).css("position","static").css("z-index","99999").css("top","0px");
	         			  $("."+opts.eles).removeAttr("style");
	         			 $("."+opts.taks_left).removeAttr("style");
	         			 $("."+opts.taks_right).removeAttr("style");
	         		}
				}
         	});

         },

         tab:function(options){

         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         			data:'Input',
         			calss:'curders',
         			elem:'task-B-wen-cont',
         			els:'task-B-wen-nav'

         		}
         		var opts=$.fn.extend({},defaults,options || {});
         		var $T=$("."+opts.elem);


         		if(opts.data=="Input"){
         			 $("."+opts.els).find("li").each(function(){
         				$(this).removeClass(opts.calss);
         			});
         			 $this.addClass(opts.calss);
         			 $T.find(".Input_li").show();
         			 $T.find(".Output_li").hide();
         		}else{
         			 $("."+opts.els).find("li").each(function(){
         				$(this).removeClass(opts.calss);
         			});
         			 $this.addClass(opts.calss);
         			 $T.find(".Input_li").hide();
         			 $T.find(".Output_li").show();

         			 $T.find("li").eq(1).show();
         		}
         	});

         },

         radios:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         			val:1,
         			elem1:'add1',
         			elem2:'add2',
         			els:'add_taolun_con'
         		}
         		var opts=$.fn.extend({},defaults,options||{});

         		if(opts.val==1){
         			$("#"+opts.elem1).show();
         			$("#"+opts.elem2).hide();
         		}else{
         			$("#"+opts.elem1).hide();
         			$("#"+opts.elem2).show();
         		}
         		return $this;
         	});

         },

         LabelApp:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         			 ids:'Lable',
			  		 elem:'Label-cont'
         		}
         		var opts=$.fn.extend({},defaults,options||{});
         		var str="";

         		var $V=$this.text();
				var had=false;
				$("#"+opts.ids).find('input').each(function(index,ele){
					if($(ele).val()==$V){
						had=true;
					}
				});
				if(had) return;
         		 srt='<input type="hidden" name="labels" value="'+$V+'"><div class="Lable-ioc left">'+$V+'<span class="right" onclick="Labelspan(this);">x</span></div>';

         		 $("#"+opts.ids).append(srt);
         		  var $S= $("#"+opts.ids).height();
         		 $("#"+opts.ids).css("height","auto");
         		 $("."+opts.elem).css("top",$S+5+"px");
         		return $this;

         	});


         },
         Labeltabs:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={

			  		 elem:'Lable-ioc'
         		}
         		var opts=$.fn.extend({},defaults,options||{});
   				$("."+opts.elem).show();
         		return $this;

         	});
         },
         OutHide:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={

			  		 elem:'Label-cont'
         		}
         		var opts=$.fn.extend({},defaults,options||{});
   				$("."+opts.elem).hide();
         		return $this;

         	});
         },
          LabelApp2:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         			 ids:'Lable',
         			 elem:'Lable-input',
			  		  eles:'Label-cont'
         		}
         		var opts=$.fn.extend({},defaults,options||{});
         		var str="";
         		var $V=$this.parent().find("."+opts.elem).val();

         		if($V!=""){
         			srt='<input type="hidden" name="labels" value="'+$V+'"><div class="Lable-ioc left">'+$V+'<span class="right" onclick="Labelspan(this);">x</span></div>';
         		 	$("#"+opts.ids).append(srt);
         		}else{

         		}
         		 $this.parent().find("."+opts.elem).val("");
         		  var $S= $("#"+opts.ids).height();
         		 $("#"+opts.ids).css("height","auto");
         		 $("."+opts.eles).css("top",$S+5+"px");
         		return $this;

         	});


         },

         Template:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         			 falg:true,
         			 next_span:false,
		         	 elem:'add_text',
		         	 eles:'Template-rel',
		         	 sid:'main',
		         	 tops:'xian_mu_top',
         			 dis:'pro_main',
         			 change:false,
         			 save:'add-bu',
         			 save_in:'add-jd',
         			 appen:'add_con_list',
         			 more:false,
         			 site:'sites',
         			 orgId:20,
         			 types:1,
         			 Level:1
         		}
         		var opts=$.fn.extend({},defaults,options || {});
         		//判断显示的层的位置

         		var $XY=$this.offset();
         		//var T_height = $(".Template-rel ").height();
         		var T_height = $(this).closest(".Template-rel").height();
         		var Sheight=$this.height();
         		//获取高度
         		var $Bh=$("#"+opts.sid).height();
         		var $Bt=$("."+opts.tops).height();
         		var $Bd=$("."+opts.dis).height();
         		var max=$Bh+$Bt+$Bd;

         		//console.log(max);

         	    //显示弹出层
         		var $D;
         		if (typeof opts.elem =="string"){
         		    $D = $this.next("." + opts.elem);
         		}
         		else {
         		    $D = $(opts.elem)
         		}
         		var $S=$D.find("."+opts.save);
         		if(opts.change){

         			$D.show();
         			 $D.find("li").click(function(){
         			 	 $D.find("li").each(function(){
         			 	 	$(this).removeAttr("style");
         			 	 	$(this).find("span").hide();
         			 	 });
         			 	var text=$(this).text();
         			 	var data=$(this).attr("data");
         			 	 $(this).find("span").show();
         			 	 $(this).css("background","#f2f2f2");
         			 	 if(opts.next_span){
         			 	 	 $this.find("span").text(text);
         			 	 	  $this.find("span").attr("data",data);
         			 	 }else{
         			 	 	 $this.val(text);
         			 	 	 $this.attr("data",data);
         			 	 }

         			 });
         		}else{
         			 $D.find("li").click(function(){
         			 	 $D.find("li").each(function(){
         			 	 	$(this).removeAttr("style");
         			 	 	$(this).find("span").hide();
         			 	 });
         			 	var text=$(this).text();
         			 	var data=$(this).attr("data");
         			 	 $(this).find("span").show();
         			 	 $(this).css("background","#f2f2f2");
         			 	 if(opts.next_span){
         			 	 	 $this.find("span").text(text);
         			 	 	  $this.find("span").attr("data",data);
         			 	 }else{
         			 	 	 $this.val(text);
         			 	 	 $this.attr("data",data);
         			 	 }

         			 });

         		}

         		var add_height=$D.height();
         		if(opts.falg)
         		{
         			if(($XY.top+add_height)>max){
         				 //console.log(add_height);
         				$D.css("top",-(add_height+T_height-Sheight)+"px");
         				$D.show();

         			}else{

         				$D.css("top",T_height+"px");
         				$D.show();

         			}
         			//单选
         			if(opts.Level==1){
         				/*添加第一级*/
         				 $D.find("li").click(function(){
         			 	 $D.find("li").each(function(){
         			 	 	$(this).removeAttr("style");
         			 	 	$(this).find("span").hide();
         			 	 });
         			 	var text=$(this).text();
         			 	var data=$(this).attr("data-id");
         			 	 $(this).find("span").show();
         			 	 $(this).css("background","#f2f2f2");
         			 	 $this.val(text);
         			 	 $this.parent().find("input:hidden").attr("data-id",data);
         			 });

         			 $S.click(function(){
         			 	var add_name=$D.find("."+opts.save_in).val();
         			 	//ajax
		         			 $.ajax({
									type : "POST",
									url : ""+opts.site+"company/addtag.action",
									data : {"otag.orgId" : opts.orgId,"otag.name":add_name,"otag.type":opts.types},
									success : function(str) {
										var sid=str.id;
				         			 	var srt="";
				         			 	str='<li data-id="'+sid+'"><a href="javascript:;">'+add_name+'</a> <span class="right gouxuan"></span></li>';
				         			 	$D.find("."+opts.appen).append(str);
				         			 	$D.find("."+opts.save_in).val("");
									}
								});

         			 	//ajax

         			 });
         			 /*添加第一级*/
         			}else if(opts.Level==2){
         				/*添加第二级*/
         				 $D.find("li").click(function(){
         			 	 $D.find("li").each(function(){
         			 	 	$(this).removeAttr("style");
         			 	 	$(this).find("span").hide();
         			 	 });
         			 	var text=$(this).text();
         			 	var data=$(this).attr("data-id");
         			 	 $(this).find("span").show();
         			 	 $(this).css("background","#f2f2f2");
         			 	 $this.val(text);
         			 	 $this.parent().find("input:hidden").attr("data-id",data);
         			 });

         			 $S.click(function(){
         			 	var add_name=$D.find("."+opts.save_in).val();
         			 	//ajax
		         			 $.ajax({
									type : "POST",
									url : ""+opts.site+"company/addtag.action",
									data : {"otag.orgId" : opts.orgId,"otag.name":add_name,"otag.type":opts.types},
									success : function(str) {
										var sid=str.id;
				         			 	var srt="";
				         			 	str='<li data-id="'+sid+'"><a href="javascript:;">'+add_name+'</a> <span class="right gouxuan"></span></li>';
				         			 	$D.find("."+opts.appen).append(str);
				         			 	$D.find("."+opts.save_in).val("");
									}
								});

         			 	//ajax

         			 });

         				/*添加第二级*/
         			}


         		}else{
         			//name

         				$("."+opts.elem).each(function(){
         					$(this).hide();
         				});
         				$D.show();

         				$D.find("li").click(function(){
         			 	 $D.find("li").each(function(){
         			 	 	$(this).removeAttr("style");
         			 	 	$(this).find("span").hide();
         			 	 });
         			 	var text=$(this).text();
         			 	var data=$(this).attr("data");
         			 	 $(this).find("span").show();
         			 	 $(this).css("background","#f2f2f2");
         			 	 $this.val(text);
         			 	 $this.attr("data",data);
         			 });
         		}


         		//显示结束


         		 return $this;

         	});
         },
          Template_sele:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         			 next_span:false,
		         	 elem:'add_text',
		         	 eles:'Template-rel',
		         	 sid:'main',
		         	 tops:'xian_mu_top',
         			 dis:'pro_main',
         			 change:false,
         			 save:'add-bu',
         			 save_in:'add-jd',
         			 appen:'add_con_list',
         			 more:false,
         			 site:'sites'

         		}
         		var opts=$.fn.extend({},defaults,options || {});
         		 var $D=$this.next("."+opts.elem);
         		 var texts=new Array();
         		 var names=new Array();
         		 var title=new Array();
         		 texts="";
         		 names="";
         		  title="";
         		if(opts.more){
         			$D.show();
         			 $D.find("li").click(function(){
         			 	 var _this=$(this);
         			 	var text=$(this).attr("data-title");
         			 	var data_id=$(this).attr("data-id");
         			 	var data_name=$(this).attr("data-name");
         			 	var news=data_id+"_"+data_name+"_"+text;

         			 		//ajax
         			 	var privilegeId  = $("#addmember").attr("target");
         			 		$.ajax({
							type : "POST",
							url : ""+opts.site+"project/plan/privilege/role/same.action",
							data : {
								"projectRoleAuthority.privilegeId" : privilegeId,
								"projectRoleAuthority.roleId" : data_id,
								"projectRoleAuthority.projectId" : $('#id').val(),
								"projectRoleAuthority.roleType" :2
							},
							async : false,
							dataType : "json",
							success : function(str) {
								if(str.success){
									names="";
		         			 		texts="";
		         			 		title="";
		         			 		_this.find("span").hide();
		         			 		_this.removeAttr("style");
		         			 		//console.log("A");
		         			 		$D.find("input:hidden").each(function(){
		         			 			 var ids=$(this).attr("data_id");
		         			 			 if(ids==data_id){
		         			 			 	$(this).remove();
		         			 			 	return true;
		         			 			 }
		         			 		});

		         			 		$D.find("input:hidden").each(function(){
		         			 			var data_og=$(this).attr("data_g");
		         			 			var data_text=$(this).val();
		         			 			names+=data_og+",";
		         			 			texts+=data_text+",";
         			 				});
		         			 		  $this.val(texts);
         			 	  			  $this.attr("data_og",names);
									alert("该用户已经在角色组中");
								}
								else{
									var str="";

									 names="";
         			 		 texts="";
         			 		 title="";
         			 	 	 var dispp=_this.find("span").css("display");

         			 	 if(dispp=="block"){
         			 	 	var id_ff=_this.attr("data-id");
         			 	 	$D.find("input:hidden").each(function(){
         			 	 			 var ids=$(this).attr("data_id");
		         			 			 if(ids==id_ff){
		         			 			 	//console.log($(this));
		         			 			 	$(this).remove();
		         			 			 	return false;
		         			 			 }
         			 	 		});
         			 	 	_this.find("span").hide();
         			 	 	_this.removeAttr("style");
         			 	 }else{
         			 	 	str='<input type="hidden" data_id="'+data_id+'"  data_g="'+news+'" value="'+text+'" >'
         			 	 	 $D.append(str);
         			 	 	_this.find("span").show();
         			 		_this.css("background","#f2f2f2");
         			 	 }

         			 	$D.find("input:hidden").each(function(){
         			 			var data_og=$(this).attr("data_g");
         			 			var data_text=$(this).val();
         			 			names+=data_og+",";
         			 			texts+=data_text+",";
         			 	});




         			 	  $this.val(texts);
         			 	  $this.attr("data_og",names);
								}
								}
							});
         			 	//ajax



         			 	/*if($(this).find("span").css("display")=="block"){
         			 		names="";
         			 		texts="";
         			 		title="";
         			 		$(this).find("span").hide();
         			 		$(this).removeAttr("style");
         			 		//console.log("A");
         			 		$D.find("input:hidden").each(function(){
         			 			 var ids=$(this).attr("data_id");
         			 			 if(ids==data_id){
         			 			 	$(this).remove();
         			 			 	return true;
         			 			 }
         			 		});

         			 		$D.find("input:hidden").each(function(){
         			 			var data_og=$(this).attr("data_g");
         			 			var data_text=$(this).val();
         			 			names+=data_og+",";
         			 			texts+=data_text+",";

         			 		});

         			 	}else{
         			 		 names="";
         			 		 texts="";
         			 		 title="";
         			 	$(this).find("span").show();
         			 	$(this).css("background","#f2f2f2");
         			 		//console.log("B");
         			 	$D.append(str);
         			 	$D.find("input:hidden").each(function(){
         			 			var data_og=$(this).attr("data_g");
         			 			var data_text=$(this).val();

         			 			names+=data_og+",";
         			 			texts+=data_text+",";
         			 		});

         			 	}
*/



         			 });

         		}



         		return $this;
         	});
         },

         Template_js:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         			ids:'Stage-tam',
		         	elem:'add_con_list',
		         	sid:'main',
		         	tops:'xian_mu_top',
         			dis:'pro_main',
		         	add_list:'add-ins',
		         	z_index:99999,
		         	site:'site',
		         	types:1
         		};
         		var opts=$.fn.extend({},defaults,options ||{});
         		var $X=$this.offset();
         		var $D=$("#"+opts.ids).find("."+opts.elem);
         		var $add=$("#"+opts.ids).find("."+opts.add_list);
         		//获取高度
         		var $Bh=$("#"+opts.sid).height();
         		var $Bt=$("."+opts.tops).height();
         		var $Bd=$("."+opts.dis).height();
         		var max=$Bh+$Bt+$Bd;

         		var Tak_height=$("#"+opts.ids).height();
         		var The_hieght=$this.height();

         		 if($X.top+Tak_height+The_hieght>=max){
         		 	$("#"+opts.ids).css("left",$X.left+"px").css("top",$X.top-Tak_height-The_hieght+"px").css("z-index",opts.z_index);
         		 	$("#"+opts.ids).show();
         		 }
         		 else{
         		 	$("#"+opts.ids).css("left",$X.left+"px").css("top",$X.top+The_hieght+"px");
         		 	$("#"+opts.ids).show();
         		 }
         		 //列表点击
         		 $("#" + opts.ids).data('target', $this);
         		 //添加列表
         		 $add.find("input:button").click(function(){

         		 		var add_name=$add.find("input:text").val();
         			 	//ajax
		         			 $.ajax({
									type : "POST",
									url : ""+opts.site+"company/addtag.action",
									data : {"otag.orgId" : opts.orgId,"otag.name":add_name,"otag.type":opts.types},
									success : function(str) {
										var sid=str.id;
				         			 	var srt="";
				         			 	str='<li data-id="'+sid+'"><a href="javascript:;">'+add_name+'</a> <span class="right gouxuan"></span></li>';
				         			 	$D.find("."+opts.elem).append(str);
				         			 	$add.find("input:text").val("");
									}
								});

         			 	//ajax
         		 });


         		return $this;
         	});

         },
          Template_jd:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         			ids:'Professional-tam',
		         	elem:'add_con_list',
		         	sid:'main',
		         	tops:'xian_mu_top',
         			dis:'pro_main',
		         	add_list:'add-ins',
		         	z_index:99999,
		         	site:'site',
		         	types:1
         		};
         		var opts=$.fn.extend({},defaults,options ||{});
         		var $X=$this.offset();
         		var $D=$("#"+opts.ids).find("."+opts.elem);
         		var $add=$("#"+opts.ids).find("."+opts.add_list);
         		//获取高度
         		var $Bh=$("#"+opts.sid).height();
         		var $Bt=$("."+opts.tops).height();
         		var $Bd=$("."+opts.dis).height();
         		var max=$Bh+$Bt+$Bd;

         		var Tak_height=$("#"+opts.ids).height();
         		var The_hieght=$this.height();

         		 if($X.top+Tak_height+The_hieght>=max){
         		 	$("#"+opts.ids).css("left",$X.left+"px").css("top",$X.top-Tak_height-The_hieght+"px").css("z-index",opts.z_index);
         		 	$("#"+opts.ids).show();
         		 }
         		 else{
         		 	$("#"+opts.ids).css("left",$X.left+"px").css("top",$X.top+The_hieght+"px");
         		 	$("#"+opts.ids).show();
         		 }
         		 $("#" + opts.ids).data('target', $this);

         		 //添加列表
         		 $add.find("input:button").click(function(){

         		 		var add_name=$add.find("input:text").val();
         			 	//ajax
		         			 $.ajax({
									type : "POST",
									url : ""+opts.site+"company/addtag.action",
									data : {"otag.orgId" : opts.orgId,"otag.name":add_name,"otag.type":opts.types},
									success : function(str) {
										var sid=str.id;
				         			 	var srt="";
				         			 	str='<li data-id="'+sid+'"><a href="javascript:;">'+add_name+'</a> <span class="right gouxuan"></span></li>';
				         			 	$D.find("."+opts.elem).append(str);
				         			 	$add.find("input:text").val("");
									}
								});

         			 	//ajax
         		 });


         		return $this;
         	});

         },
          Relation:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         			ids:'related'
         		};
         		var opts=$.fn.extend({},defaults,options ||{});

         		var $B=$this.find("span").css("display");

         		if($B=="block"){
         			$this.find("span").css("display","none");
         			$this.removeAttr("style");
         		}else{
         			$this.find("span").css("display","block");
         			$this.css("background","#e4e4e4");
         		}

         		return $this;
         	});

         },

          add_bu:function(options){
         	return $(this).each(function(){
         		var $this=$(this);
         		var defaults={
         	     ids:'ids',
         		 site:'site',
	        	 orgId:1,
	        	 type:2,
	        	 eles:'add_con',
	        	 elem:'add_con_list'
         		};
         		var opts=$.fn.extend({},defaults,options ||{});
         		var $D=$("#"+opts.ids).find('.'+opts.eles);
         		var $targets=$("#"+opts.ids).data("target");

         		var add_name=$this.parent().find("input:text").val();
         		var url=""+opts.site+"company/addtag.action";
					 $.ajax({
							type : "POST",
							url : url ,
							data : {"otag.orgId" : opts.orgId,"otag.name":add_name,"otag.type":opts.type},
							success : function(str) {
								str =eval('('+str+')');
								if(str.success){
									var sid=str.id;
					         	 	var srt="";
					         	 	str='<li data-id="'+sid+'"><a href="javascript:;">'+add_name+'</a> <span class="right gouxuan"></span></li>';
					         			 	$D.find("."+opts.elem).append(str);
					         			 	$D.find("input:text").val("");
					         			 	$targets.val(add_name);
										}else{
											alert(str.msg);
										}

									}
								});

         			 	//ajax


         		return $this;
         	});

         }


	};


	$.fn.information=function(){
		var method=arguments[0];
		if(methods[method]){ 
			method=methods[method];
			 arguments = Array.prototype.slice.call(arguments, 1);
		}else if(typeof method === 'object' || !method ){ 

			method=methods.init;
		}else{ 

			$.error(method);
			return this;
		}

		return method.apply(this,arguments);

	};


})(jQuery);